<script>
function get_party(id_head){

$.post("<?= site_url('accounts/party/get_party')?>",{ id_head : id_head }, function(msg){
							if(msg){
								//alert(msg)
								$("#report").show();
								$("#report").html(msg);
								
							}
		
						})

}


function get_uniquecustomer(id_user,counter){
	var r_id =  "#unique_report"+counter
	
$.post("<?= site_url('accounts/party/uniquecustomer')?>",{ id_user : id_user, counter: counter }, function(msg){
							if(msg){
								$(r_id).show()
								$(r_id).html(msg);
								
							}
		
						})


}

function hide_uniquecustomer(counter){
	var r_id =  "#unique_report"+counter
	$(r_id).hide()
	
}

function get_uniquesupplier(id_user,counter){
	var r_id =  "#unique_report"+counter
$.post("<?= site_url('accounts/party/uniquesupplier')?>",{ id_user : id_user, counter: counter }, function(msg){
							if(msg){
								$(r_id).show()
								$(r_id).html(msg);
								
							}
		
						})


}

function hide_uniquesupplier(counter){
	var r_id =  "#unique_report"+counter
	$(r_id).hide()
	
}





</script>

<script type="text/javascript">
  function PrintDiv() {    
           var divToPrint = document.getElementById('print');
           var popupWin = window.open('', '_blank', 'width=800,height=800');
           popupWin.document.open();
           popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
            popupWin.document.close();
                }
</script>	


<script type="text/javascript">
  function print_report(){
            
			
var clicky = document.getElementById("ok");

clicky.onclick = function(){
    window.open(clicky.href, "test");    
    return false;        
}​
			 
}
			


</script>	





<h2>Search Item </h2>
<div class="row-fluid">
<div class="span5">&nbsp;&nbsp;&nbsp;</div>
<div class="span2">
<table width="100%" >
<tr><td><b>Account Heads:</b></td></tr>
<tr>
         	<td><select name="source_branch" onchange="get_party(this.value);" class="chzn-select">
    			<option value="">-- Select-- </option>
				<?php foreach ($heads as $head) {?>
			    <option value="<?=$head->id?>" <?php 
				if(isset($edit)) {
				if($edit['user_id'] == $head->id)
				{
					echo 'selected = "selected"';
				}
				}
				else {
					echo set_select('id_head',$head->id);
				}
				?> ><?= $head->name;?></option >
   				 <?php } ?>
    		</select>
		</td>
       </tr>

	</table>
	</div>
	<div class="span5">&nbsp;&nbsp;&nbsp;</div>
</div>	
<div class="line"></div>
<div class="row-fluid">
<div class="span12" id="report" style="display: none">
lkhkjthkjtrhekj
</div>	
	